package org.nepu.scr.indexrate.converter.compliancerate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.operationreliability.PressureTest1_1;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class PressureTestConverter1_1 implements AttributeConverter<PressureTest1_1, String> {
    @Override
    public String convertToDatabaseColumn(PressureTest1_1 pressureTest) {
        return JSONUtil.toJsonStr(pressureTest);
    }

    @Override
    public PressureTest1_1 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PressureTest1_1.class);
    }
}
